var M=require("ming_node");

require('./config/index.js')
const Db=require("./dao/Db")
global.Db=Db;

var app=M.server();
app.listen(8888);
global.app=app;

//公共方法
require("./common/index")
//后台管理
require("./controller/manager/index.js");

//主拦截器
app.begin((req, res)=>{
   if(req.url=="/"){
        res.redirect("/index.html");
        return;
    }
    if(!req.isStaticRequest()){
        console.log(req.url,req.params)
    }
    if(req.method=="OPTIONS"){ res.send({}); return}
})

